package th1701_sinhvien;

import java.util.Scanner;

public class SinhVien {
	private String mssv;
	private String hoTen;
	private String diaChi;
	private String email;
	private String soDienThoai;
	
	//Phuong thuc khoi tao khong tham so
	public SinhVien (){
		
	}
	
	//Phuong thuc khoi tao co tham so
	public SinhVien(String mssv, String hoTen, String diaChi, String email, String soDienThoai){
		this.mssv = mssv;
		this.hoTen = hoTen;
		this.diaChi = diaChi;
		this.email = email;
		this.soDienThoai = soDienThoai;
	}
	
	//Phuong thuc nhap
	public void nhap(){
		Scanner str = new Scanner(System.in);
		System.out.println("Vui long nhap ma so sinh vien");
		this.mssv = str.nextLine();
		System.out.println("Vui long nhap ho ten sinh vien");
		this.hoTen = str.nextLine();
		System.out.println("Vui long nhap dia chi sinh vien");
		this.diaChi = str.nextLine();
		System.out.println("Vui long nhap email sinh vien");
		this.email = str.nextLine();
		System.out.println("Vui long nhap so dien thoai sinh vien");
		this.soDienThoai = str.nextLine();
	}

	//Phuong thuc xuat
	public void inThongTin(){
		System.out.println("Ma so sinh vien: " + mssv);
		System.out.println("Ho ten sinh vien: " + hoTen);
		System.out.println("Dia chi sinh vien: " + diaChi);
		System.out.println("Email sinh vien: " + email);
		System.out.println("So dien thoai sinh vien: " + soDienThoai);
	}
	
	//Phuong thuc so sanh thong tin hai sinh vien
	public boolean equals(SinhVien q){
		boolean kq1 = this.mssv.equalsIgnoreCase(q.mssv);
		boolean kq2 = this.hoTen.equalsIgnoreCase(q.hoTen);
		boolean kq3 = this.diaChi.equalsIgnoreCase(q.diaChi);
		boolean kq4 = this.email.equalsIgnoreCase(q.email);
		boolean kq5 = this.soDienThoai.equalsIgnoreCase(q.soDienThoai);
		
		return kq1 && kq2 && kq3 && kq4 && kq5;
	}
	
	//Phuong thuc kiem tra ma sinh vien nhap vao
	public boolean kiemTraMSSV(String mssv){
		return this.mssv.equalsIgnoreCase(mssv);
	}

}
